function logout () {
  $.cookie('uName', '', { expires: -1 });
  window.location = 'index.html';
}
function checkState () {
  var u = $.cookie('uName');
  if (u && $('#loginState')) {
    $('#loginState').html('欢迎您,['+u+'],小二等候多时了! <a href="javascript:logout();">安全退出</a>');
  }
}
checkState();